import java.util.Scanner;



/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2023-04-11
 * Time: 9:03
 */
//汽水瓶问题
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        //n代表拥有的空瓶数
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            if(n==0){
               break;
            }else{
                n=n/2;
            }
            
        System.out.println(n);         

        }


    }
}

   